package com.rpframework.website.device.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.rpframework.core.BaseService;
import com.rpframework.utils.Pager;
import com.rpframework.website.device.dao.IShoppingCartDao;
import com.rpframework.website.device.domain.Goods;
import com.rpframework.website.device.domain.ShoppingCart;
@Service
public class ShoppingCartService extends BaseService{
	@Resource public  IShoppingCartDao idao;
	
	
	
	public Pager<ShoppingCart> getpager(Pager<ShoppingCart> pager) {
		long startTime = System.currentTimeMillis();
		List<ShoppingCart> list = idao.doPager(this.packageMyBatisParam(pager));
		pager.setItemList(list);
		pager.setCostTime(System.currentTimeMillis() - startTime);
		return pager;
	}



	public List<ShoppingCart> selectmycart(Integer id) {
		return idao.selectmycart(id);
	}



	public List<ShoppingCart> getCartGoodsByUser(Integer userId) {
		
		return idao.doCartGoodsByUser(userId);
	}
	public void doCleanCart(List<Integer> ids) {
		idao.deleteCart(ids);
	}

}
